<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文章管理 - 会员中心 - 散文吧</title>
<link href="__ROOT__/shiwen/pc/xin/css/manage.css" rel="stylesheet" type="text/css" />
<script src="__ROOT__/shiwen/pc/xin/js/sweetalert.min.js"></script>
<link rel="stylesheet" type="text/css" href="__ROOT__/shiwen/pc/xin/css/sweetalert.css">
<script src="https://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function deldraft(id,status){
    swal({
        title: "您确定要删除吗？", 
        text: "您确定要删除这条数据？", 
        type: "warning",
        showCancelButton: true,
        closeOnConfirm: false,
        confirmButtonText: "是的，我要删除",
        confirmButtonColor: "#ec6c62"
    }, function() {

        $.ajax({
            url: '/articleDel',
            type: 'POST',
            dataType: 'json',
            data: {
                'id': id,
                'status': status
            },
            success: function(res) {
                if (res.code == 200) {
                    $("#tr_"+id).slideUp();
                    swal("Good!", res.msg, "success");
                    // setTimeout(function(){
                    //     window.location.href = "/member_center.html";
                    // },1000);
                } else {
                    swal("OMG!", res.msg, "error");
                }
            }

        });

    });
}

function gai(){
    swal("客官，审核过了，就不能修改了!");
}
</script>
</head>
<body>
    <div class="wrapper">
        {include file="pc/member/header"}
        <div id="content">
            <div id="article">
                <h2>
                    <span>
                        <a href="/articleForm.html">写文章</a>
                        <a href="/loveForm.html">写叁行情书</a>
                    </span>文章管理
                </h2>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <thead>
                        <tr>
                            <td class="title">标题</td>
                            <td width="10%">状态</td>
                            <td width="10%">阅读量</td>
                            <td width="20%">时间</td>
                            <td width="20%">操作</td>
                        </tr>
                    </thead>
                    {volist name="list" id="vo"}
                    <tr id="tr_{$vo.id}">
                        <td class="title">
                            <a href="/article/{$vo.id}.html" target="_blank">{$vo.title}</a>&nbsp;
                        </td>
                        <td>
                            {if $vo.status == 0}
                            <font color="#FFA500">待审核</font>  <!-- 橙色 -->
                            {elseif $vo.status == 1 /}
                            <font color="green">已发布</font>    <!-- 绿色 -->
                            {elseif $vo.status == 2 /}
                            <font color="red">审核失败</font>   <!-- 红色 -->
                            {elseif $vo.status == 3 /}
                            <font color="#999">已下架</font>    <!-- 灰色 -->
                            {/if}
                        </td>
                        <td>{$vo.access}</td>
                        <td>{$vo.add_time}</td>
                        <td class="tools">
                            {if $vo.status == 0}
                                <a href="/articleForm/{$vo.id}.html">修改</a> |
                                <a href="javascript:void(0)" onclick="deldraft({$vo.id},4)">删</a>
                            {else /}
                                <a onclick="gai()">修改</a> | 
                                <a href="javascript:void(0)" onclick="deldraft({$vo.id},4)">删</a>
                            {/if}
                        </td>
                    </tr>
                    {/volist}
                    <tr><td colspan="5" class="page1"></td></tr>
                </table>
            </div>
        </div>
        <div id="footer">&copy;2006-2013 www.okshiwen.cn</div>
    </div>
</body>
</html>